from django.db import models
from django.contrib import admin
from .models import Grades
from .models import Students


# Register your models here.

# 学生
@admin.register(Students)
class Studentsadmin(admin.ModelAdmin):
    def delete(self):
        if self.isDelete:
            return '已删除'
        else:
            return '未删除'
    delete.short_description = '状态'
    list_display = ['id', 'sname', 'sage', 'ssex', 'sheight', 'sweight', 'sdescription', delete, 'screteTime',
                    'supdateTime']
    list_filter = ['id', 'sname']


# 班级
@admin.register(Grades)
class Gradesadmin(admin.ModelAdmin):
    def delete(self):
        if self.isDelete:
            return '已删除'
        else:
            return '未删除'
    delete.short_description = '状态'
    list_display = ['id', 'gname', 'gteacher', 'ggirlnum', 'gboynum', 'isDelete',
                        'gcreateTime', 'gupdateTime']